#!/usr/bin/env node

const http = require('http'),
      log  = console.log;

http.createServer((req,res)=>{
  log(`${req.method} ${req.url} HTTP/${req.httpVersion}`);  //起始行
  log(req.headers); //请求头
  log('');  //请求体 管道
  
  req.pipe(process.stdout);

  res.end('ok!');
}).listen(8080);
